package com.wf.day_0601.test2;

import java.util.Arrays;
import java.util.HashMap;
import java.util.Random;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @author mpk
 * @since 2024/6/1 15:08:54
 */
public class Demo {
    public static void main(String[] args) {


        HashMap<Integer, String> hs = new HashMap<>();

        hs.put(1, "张三");
        hs.put(2, "李四");
        hs.put(3, "王五");
        ConcurrentHashMap<Object, Object> objectObjectConcurrentHashMap = new ConcurrentHashMap<>();

        Random random = new Random();

        int[] a = new int[5];


        for (int j = 0; j < a.length; j++) {
            int i1 = random.nextInt(10);

            for (int i = 0; i < a.length; i++) {

                if (a[i] == i1) {
                    i1 = random.nextInt(10);
                    i = -1;
                }
            }

            a[j] = i1;


        }
        System.out.println(Arrays.toString(a));


    }


}
